package nciae.db.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import nciae.db.pojo.entity.Log;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 安少康
 * @since 2024-12-12
 */
@Component
@Mapper
public interface LogMapper extends BaseMapper<Log> {

    @Select("select avg(score) from stu_log where user_id=#{userId}")
    Double getAverageScore(Integer userId);

    @Delete("delete from stu_log where user_id=#{userId}")
    void deleteByUserId(Integer userId);
}
